package edu.sctu.practice.class01.zhengsenwen.test.test12;

/**
 * Created by zhengsenwen on 2015/11/19.
 */
public class Cars {

//    【练习题】12.构造方法与重载
//    建立一个汽车类，包括轮胎个数，汽车颜色，车身重量等属性。并通过不同的构造方法创建事例。
//    至少要求：汽车能够加速，减速，停车。
//    要求：命名规范，代码体现层次，有友好的操作提示。

    public int numOfTire = 0;
    public String color = "";
    public float weight = 0.0f;

    public Cars(int numOfTire, String color, float weight) {
        this.numOfTire = numOfTire;
        this.color = color;
        this.weight = weight;
    }
    public Cars(int numOfTire, String color) {
        this.numOfTire = numOfTire;
        this.color = color;
    }

    public Cars(int numOfTire, float weight) {
        this.numOfTire = numOfTire;
        this.weight = weight;
    }

    public Cars(String color, float weight) {
        this.color = color;
        this.weight = weight;
    }

    public Cars(int numOfTire) {
        this.numOfTire = numOfTire;
    }

    public Cars(String color) {
        this.color = color;
    }

    public Cars(float weight) {
        this.weight = weight;
    }

    public void increaseSpeed(){
        System.out.println("加速");
    }

    public void reduceSpeed(){
        System.out.println("减速");
    }

    public void freezing(){
        System.out.println("停车");
    }
}
